#include<bits/stdc++.h>
using namespace std;
#define int long long

const int MOD = 998244353;

signed main() {
//	system("start https://www.lanqiao.cn/problems/18199/learning/");

    int n;
    cin >> n;

    string s;
    cin >> s;

    int ans = 'z' - s.end()[-1];

    auto p = s.end();
	int t = 26;

    for(int i = 2; i <= n; i++) {
        ans = ans % MOD + ('z' - p[-i]) * t;
        t = t % MOD * 26;
    }

    cout << ans % MOD;

    return 0;
}

